import 'package:flutter/material.dart';

class Item extends StatelessWidget {
  final String title;
  final bool isActive;
  final Function(BuildContext) onTap;

  const Item({Key key, this.title, this.isActive, this.onTap})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    var color = isActive ? Colors.green : Colors.black;
    return GestureDetector(
      onTap: () {
        if (onTap != null) onTap(context);
      },
      child: Container(
        child: Row(
          children: [
            Text(
              title,
              style: TextStyle(color: color, fontSize: 20.0),
            ),
            Icon(
              Icons.arrow_drop_down,
              color: color,
              size: 14.0,
            )
          ],
        ),
      ),
    );
  }
}
